//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package issue_dao

import "go.mongodb.org/mongo-driver/mongo"

var SpritDao *_SpritDao
var SpritStateDao *_SpritStateDao
var IssueDao *_IssueDao
var SubIssueDao *_SubIssueDao
var DependDao *_DependDao
var BurnDownInfoDao *_BurnDownInfoDao
var SummaryItemDao *_SummaryItemDao
var IssueRecycleDao *_IssueRecycleDao
var VoteDao *_VoteDao

func InitDao(mgoDb *mongo.Database) (err error) {
	SpritDao, err = newSpritDao(mgoDb)
	if err != nil {
		return
	}
	SpritStateDao, err = newSpritStateDao(mgoDb)
	if err != nil {
		return
	}
	IssueDao, err = newIssueDao(mgoDb)
	if err != nil {
		return
	}
	SubIssueDao, err = newSubIssueDao(mgoDb)
	if err != nil {
		return
	}
	DependDao, err = newDependDao(mgoDb)
	if err != nil {
		return
	}
	BurnDownInfoDao, err = newBurnDownInfoDao(mgoDb)
	if err != nil {
		return
	}
	SummaryItemDao, err = newSummaryItemDao(mgoDb)
	if err != nil {
		return
	}
	IssueRecycleDao, err = newIssueRecycleDao(mgoDb)
	if err != nil {
		return
	}
	VoteDao, err = newVoteDao(mgoDb)
	if err != nil {
		return
	}
	return
}
